package org.example.blog_manage.mapper;


import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.blog_manage.model.UserInfo;

@Mapper
public interface IUserInfoMapper {


    /*
     * 根据用户名查找信息
     * */
    @Select("select * from user_info where delete_flag = 0 and user_name = #{userName}")
    public UserInfo selectByUserName(UserInfo userInfo);

    /*
    * 根据用户id查信息
    * */
    @Select("select * from user_info where delete_flag = 0 and id = #{id} ;")
    public UserInfo selectById(UserInfo userInfo);

    /*
    * 添加用户信息
    * */
    @Insert("INSERT INTO user_info (user_name,password,email) values (#{userName},#{password},#{email})")
    public Integer insertUserInfo(UserInfo userInfo);


}
